package com.android.miniProject;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
//import android.view.MotionEvent;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.view.View;
//import android.widget.Button;
//import android.view.View.OnClickListener;

public class MenuActivity extends Activity{
	    
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.menu_layout);
        
        
        OnClickListener clickListener = new OnClickListener()
        {
          @Override
          public void onClick(View actualView)
          {
        	  switch(actualView.getId()){
        	  	case R.id.button1 :       	  
        	  		// Navigation to runActivity
        	  		Intent intent = new Intent(actualView.getContext(), RunActivity.class);
        	  		startActivity(intent);
        	  		break;
        	  	case R.id.button2 : 
        	  		// Navigation to TrainingActivity
        	  		Intent intent2 = new Intent(actualView.getContext(), TrainingActivity.class);
        	  		startActivity(intent2);
        	  		break;
        	  	case R.id.button3:
        	  		Intent intent3 = new Intent(actualView.getContext(),AnalyseActivity.class);
        	  		startActivity(intent3);
        	  		break;
        	  		
        	  	case R.id.button4 : 
        	  	// Navigation to ServicesDemo (MUSIC in background : see services)
        	  		Intent intent4 = new Intent(actualView.getContext(),ServicesMusic.class);
        	  		startActivity(intent4);
        	  		break;
        	  	
        	  }
          }
       };
       
       Button newRun = (Button) findViewById(R.id.button1);
       newRun.setOnClickListener(clickListener);
       
       Button trainings = (Button) findViewById(R.id.button2);
       trainings.setOnClickListener(clickListener);
       
       Button post_run = (Button) findViewById(R.id.button3);
       post_run.setOnClickListener(clickListener);
       
       Button settings = (Button) findViewById(R.id.button4);
       settings.setOnClickListener(clickListener);
        
    }
}